#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

vector<vector<int>> YanghuiTraingle(int n)
{
    vector<vector<int>> vv(n);
    for (int i = 0; i < vv.size(); i++)
        vv[i] = vector(i + 1, 1);
    for (int i = 2; i < n; i++)
    {
        for (int j = 1; j < vv[i].size() - 1; j++)
        {
            vv[i][j] = vv[i - 1][j] + vv[i - 1][j - 1];
        }
    }

    return vv;
}

int main()
{
    int n;
    cin >> n;
    vector<vector<int>> vv = YanghuiTraingle(n);
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < vv[i].size(); j++)
        {
            if (j == 0)
                printf("%5d ", vv[i][j]);
            else
                printf("%4d ", vv[i][j]);
        }
        cout << endl;
    }

    return 0;
}